<?php
require_once 'class/DataIn/AbstractDataIN.php';
require_once 'class/DataIn/AbstractDataIN.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Time
 *
 * @author mateusz.ledzewicz
 */
class GrowthHistorical extends AbstractDataIN{
    
    protected $dataArray;
    
    public function __construct($isin, $date, $type, $numberOfData) {
        parent::__construct($isin, $date, $type, $numberOfData+3);
    }


    protected function prepareData() {
      
        $data = $this->getPreparedData();
        $count = count($data);
        
        $this->dataArray = array_values($data);
        
        foreach($this->dataArray  as $key => $line){
            if($key+3>=$count)
                break;
            
            $valueToday = $this->countGrowth($this->dataArray , $key);
            $valueYesterday = $this->countGrowth($this->dataArray , $key+1);
            $valueBeforeYesterday = $this->countGrowth($this->dataArray , $key+2);
            
            $this->data[] = array($valueToday, $valueYesterday, $valueBeforeYesterday );  
        }
        
    }
    
  
}

?>
